import Vue from 'vue'
import VueRouter from 'vue-router'
import MyLogin from '../components/MyLogin'
import MyHome from '../components/MyHome'
import MyWelcome from '../components/MyWelcome'
import MyUsers from '../components/user/MyUsers'
import '../assets/css/global.css'
import MyRights from '../components/power/MyRights'
import MyRoles from '../components/power/MyRoles'
import MyCate from '../components/goods/MyCate'
import MyParams from '../components/goods/MyParams'
import MyList from '../components/goods/MyList'
import MyAdd from '../components/goods/MyAdd'
import MyOrder from '../components/order/MyOrder'
import MyReport from '../components/report/MyReport'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    component: MyLogin
  },
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    component: MyHome,
    redirect: '/welcome',
    children: [
      {
        path: '/',
        redirect: '/welcome'
      },
      {
        path: '/welcome',
        component: MyWelcome
      },
      {
        path: '/',
        redirect: '/users'
      },
      {
        path: '/users',
        component: MyUsers
      },
      {
        path: '/',
        redirect: '/rights'
      },
      {
        path: '/rights',
        component: MyRights
      },
      {
        path: '/',
        redirect: '/roles'
      },
      {
        path: '/roles',
        component: MyRoles
      },
      {
        path: '/',
        redirect: '/categories'
      },
      {
        path: '/categories',
        component: MyCate
      },
      {
        path: '/',
        redirect: '/params'
      },
      {
        path: '/params',
        component: MyParams
      },
      {
        path: '/',
        redirect: '/goods'
      },
      {
        path: '/goods',
        component: MyList
      },
      {
        path: '/',
        redirect: '/goods/add'
      },
      {
        path: '/goods/add',
        component: MyAdd
      },
      {
        path: '/',
        redirect: '/orders'
      },
      {
        path: '/orders',
        component: MyOrder
      },
      {
        path: '/',
        redirect: '/reports'
      },
      {
        path: '/reports',
        component: MyReport
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
